package edu.cmu.aes.project2.ws.supplier;

public class SupplierServiceProxy implements edu.cmu.aes.project2.ws.supplier.SupplierService {
  private String _endpoint = null;
  private edu.cmu.aes.project2.ws.supplier.SupplierService supplierService = null;
  
  public SupplierServiceProxy() {
    _initSupplierServiceProxy();
  }
  
  public SupplierServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initSupplierServiceProxy();
  }
  
  private void _initSupplierServiceProxy() {
    try {
      supplierService = (new edu.cmu.aes.project2.ws.supplier.SupplierServiceServiceLocator()).getSupplierServicePort();
      if (supplierService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)supplierService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)supplierService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (supplierService != null)
      ((javax.xml.rpc.Stub)supplierService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public edu.cmu.aes.project2.ws.supplier.SupplierService getSupplierService() {
    if (supplierService == null)
      _initSupplierServiceProxy();
    return supplierService;
  }
  
  public java.lang.String[] getBrands() throws java.rmi.RemoteException{
    if (supplierService == null)
      _initSupplierServiceProxy();
    return supplierService.getBrands();
  }
  
  public edu.cmu.aes.project2.ws.supplier.BikeInfo getDetails(java.lang.String arg0) throws java.rmi.RemoteException{
    if (supplierService == null)
      _initSupplierServiceProxy();
    return supplierService.getDetails(arg0);
  }
  
  public java.lang.String[] getModels(java.lang.String arg0) throws java.rmi.RemoteException{
    if (supplierService == null)
      _initSupplierServiceProxy();
    return supplierService.getModels(arg0);
  }
  
  public boolean placeOrder(edu.cmu.aes.project2.ws.supplier.Order arg0) throws java.rmi.RemoteException{
    if (supplierService == null)
      _initSupplierServiceProxy();
    return supplierService.placeOrder(arg0);
  }
  
  
}